import { http } from "../http";
const baseUrl = "/api/evaluateTask";

export interface EvaluateTaskResultType {
  id: string;
  taskId: string;
  templateId: string;
  quotaId: string;
  quotaName: string;
  averageScore: number;
  absoluteScore: number;
  medianScore: number;
  standardDeviationScore: number;
  segmentScore: string;
  isTotalScore: boolean;
  expertId: string;
  note: string;
  evaluatePerson: string;
  createTime: string;
  updateTime: string;
}

export interface GetEvaluateTaskResultQueryType {
  evaluateTaskId: string;
  expertId?: string;
}

export interface AddOrUpdateEvaluateTaskResultQueryType {
  evaluateTaskId: string;
  templateId: string;
  expertId: string;
  note: string;
  evaluatePerson: string;
  evaluateResultList: EvaluateTaskResultType[];
}

// 获取评价任务结果
export const getEvaluateTaskResultAPI = (
  params: GetEvaluateTaskResultQueryType
) => {
  return http.post(`${baseUrl}/getEvaluateResult`, params);
};

// 添加或修改评价任务结果
export const addOrUpdateEvaluateTaskResultAPI = (
  params: AddOrUpdateEvaluateTaskResultQueryType
) => {
  return http.post(`${baseUrl}/addOrUpdateEvaluateResult`, params);
};
